\(\int x (a+b \text {csch}(c+d x^2))^2 \, dx\) [12]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 45 \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 x^2}{2}-\frac {a b \text {arctanh}\left (\cosh \left (c+d x^2\right )\right )}{d}-\frac {b^2 \coth \left (c+d x^2\right )}{2 d} \]

[Out]

1/2*a^2*x^2-a*b*arctanh(cosh(d*x^2+c))/d-1/2*b^2*coth(d*x^2+c)/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {5545, 3858, 3855, 3852, 8} \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 x^2}{2}-\frac {a b \text {arctanh}\left (\cosh \left (c+d x^2\right )\right )}{d}-\frac {b^2 \coth \left (c+d x^2\right )}{2 d} \]

[In]

Int[x*(a + b*Csch[c + d*x^2])^2,x]

[Out]

(a^2*x^2)/2 - (a*b*ArcTanh[Cosh[c + d*x^2]])/d - (b^2*Coth[c + d*x^2])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3858

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Simp[a^2*x, x] + (Dist[2*a*b, Int[Csc[c + d*x], x],
 x] + Dist[b^2, Int[Csc[c + d*x]^2, x], x]) /; FreeQ[{a, b, c, d}, x]

Rule 5545

Int[((a_.) + Csch[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simpli
fy[(m + 1)/n] - 1)*(a + b*Csch[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplif
y[(m + 1)/n], 0] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \text {Subst}\left (\int (a+b \text {csch}(c+d x))^2 \, dx,x,x^2\right ) \\ & = \frac {a^2 x^2}{2}+(a b) \text {Subst}\left (\int \text {csch}(c+d x) \, dx,x,x^2\right )+\frac {1}{2} b^2 \text {Subst}\left (\int \text {csch}^2(c+d x) \, dx,x,x^2\right ) \\ & = \frac {a^2 x^2}{2}-\frac {a b \text {arctanh}\left (\cosh \left (c+d x^2\right )\right )}{d}-\frac {\left (i b^2\right ) \text {Subst}\left (\int 1 \, dx,x,-i \coth \left (c+d x^2\right )\right )}{2 d} \\ & = \frac {a^2 x^2}{2}-\frac {a b \text {arctanh}\left (\cosh \left (c+d x^2\right )\right )}{d}-\frac {b^2 \coth \left (c+d x^2\right )}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.51 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.89 \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=-\frac {b^2 \coth \left (\frac {1}{2} \left (c+d x^2\right )\right )-2 a \left (a c+a d x^2-2 b \log \left (\cosh \left (\frac {1}{2} \left (c+d x^2\right )\right )\right )+2 b \log \left (\sinh \left (\frac {1}{2} \left (c+d x^2\right )\right )\right )\right )+b^2 \tanh \left (\frac {1}{2} \left (c+d x^2\right )\right )}{4 d} \]

[In]

Integrate[x*(a + b*Csch[c + d*x^2])^2,x]

[Out]

-1/4*(b^2*Coth[(c + d*x^2)/2] - 2*a*(a*c + a*d*x^2 - 2*b*Log[Cosh[(c + d*x^2)/2]] + 2*b*Log[Sinh[(c + d*x^2)/2
]]) + b^2*Tanh[(c + d*x^2)/2])/d

Maple [A] (verified)

Time = 0.94 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.98

method result size
derivativedivides \(\frac {a^{2} \left (d \,x^{2}+c \right )-4 a b \,\operatorname {arctanh}\left ({\mathrm e}^{d \,x^{2}+c}\right )-b^{2} \coth \left (d \,x^{2}+c \right )}{2 d}\) \(44\)
default \(\frac {a^{2} \left (d \,x^{2}+c \right )-4 a b \,\operatorname {arctanh}\left ({\mathrm e}^{d \,x^{2}+c}\right )-b^{2} \coth \left (d \,x^{2}+c \right )}{2 d}\) \(44\)
parts \(\frac {a^{2} x^{2}}{2}-\frac {b^{2} \coth \left (d \,x^{2}+c \right )}{2 d}+\frac {a b \ln \left (\tanh \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right )\right )}{d}\) \(44\)
parallelrisch \(\frac {2 a^{2} d \,x^{2}-\coth \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right ) b^{2}-\tanh \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right ) b^{2}+4 \ln \left (\tanh \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right )\right ) a b}{4 d}\) \(64\)
risch \(\frac {a^{2} x^{2}}{2}-\frac {b^{2}}{d \left ({\mathrm e}^{2 d \,x^{2}+2 c}-1\right )}+\frac {a b \ln \left ({\mathrm e}^{d \,x^{2}+c}-1\right )}{d}-\frac {a b \ln \left ({\mathrm e}^{d \,x^{2}+c}+1\right )}{d}\) \(68\)

[In]

int(x*(a+b*csch(d*x^2+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/2/d*(a^2*(d*x^2+c)-4*a*b*arctanh(exp(d*x^2+c))-b^2*coth(d*x^2+c))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 271 vs. \(2 (41) = 82\).

Time = 0.28 (sec) , antiderivative size = 271, normalized size of antiderivative = 6.02 \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\frac {a^{2} d x^{2} \cosh \left (d x^{2} + c\right )^{2} + 2 \, a^{2} d x^{2} \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + a^{2} d x^{2} \sinh \left (d x^{2} + c\right )^{2} - a^{2} d x^{2} - 2 \, b^{2} - 2 \, {\left (a b \cosh \left (d x^{2} + c\right )^{2} + 2 \, a b \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + a b \sinh \left (d x^{2} + c\right )^{2} - a b\right )} \log \left (\cosh \left (d x^{2} + c\right ) + \sinh \left (d x^{2} + c\right ) + 1\right ) + 2 \, {\left (a b \cosh \left (d x^{2} + c\right )^{2} + 2 \, a b \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + a b \sinh \left (d x^{2} + c\right )^{2} - a b\right )} \log \left (\cosh \left (d x^{2} + c\right ) + \sinh \left (d x^{2} + c\right ) - 1\right )}{2 \, {\left (d \cosh \left (d x^{2} + c\right )^{2} + 2 \, d \cosh \left (d x^{2} + c\right ) \sinh \left (d x^{2} + c\right ) + d \sinh \left (d x^{2} + c\right )^{2} - d\right )}} \]

[In]

integrate(x*(a+b*csch(d*x^2+c))^2,x, algorithm="fricas")

[Out]

1/2*(a^2*d*x^2*cosh(d*x^2 + c)^2 + 2*a^2*d*x^2*cosh(d*x^2 + c)*sinh(d*x^2 + c) + a^2*d*x^2*sinh(d*x^2 + c)^2 -
 a^2*d*x^2 - 2*b^2 - 2*(a*b*cosh(d*x^2 + c)^2 + 2*a*b*cosh(d*x^2 + c)*sinh(d*x^2 + c) + a*b*sinh(d*x^2 + c)^2
- a*b)*log(cosh(d*x^2 + c) + sinh(d*x^2 + c) + 1) + 2*(a*b*cosh(d*x^2 + c)^2 + 2*a*b*cosh(d*x^2 + c)*sinh(d*x^
2 + c) + a*b*sinh(d*x^2 + c)^2 - a*b)*log(cosh(d*x^2 + c) + sinh(d*x^2 + c) - 1))/(d*cosh(d*x^2 + c)^2 + 2*d*c
osh(d*x^2 + c)*sinh(d*x^2 + c) + d*sinh(d*x^2 + c)^2 - d)

Sympy [F]

\[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\int x \left (a + b \operatorname {csch}{\left (c + d x^{2} \right )}\right )^{2}\, dx \]

[In]

integrate(x*(a+b*csch(d*x**2+c))**2,x)

[Out]

Integral(x*(a + b*csch(c + d*x**2))**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.09 \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\frac {1}{2} \, a^{2} x^{2} + \frac {a b \log \left (\tanh \left (\frac {1}{2} \, d x^{2} + \frac {1}{2} \, c\right )\right )}{d} + \frac {b^{2}}{d {\left (e^{\left (-2 \, d x^{2} - 2 \, c\right )} - 1\right )}} \]

[In]

integrate(x*(a+b*csch(d*x^2+c))^2,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 + a*b*log(tanh(1/2*d*x^2 + 1/2*c))/d + b^2/(d*(e^(-2*d*x^2 - 2*c) - 1))

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.67 \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\frac {{\left (d x^{2} + c\right )} a^{2}}{2 \, d} - \frac {a b \log \left (e^{\left (d x^{2} + c\right )} + 1\right )}{d} + \frac {a b \log \left ({\left | e^{\left (d x^{2} + c\right )} - 1 \right |}\right )}{d} - \frac {b^{2}}{d {\left (e^{\left (2 \, d x^{2} + 2 \, c\right )} - 1\right )}} \]

[In]

integrate(x*(a+b*csch(d*x^2+c))^2,x, algorithm="giac")

[Out]

1/2*(d*x^2 + c)*a^2/d - a*b*log(e^(d*x^2 + c) + 1)/d + a*b*log(abs(e^(d*x^2 + c) - 1))/d - b^2/(d*(e^(2*d*x^2
+ 2*c) - 1))

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.80 \[ \int x \left (a+b \text {csch}\left (c+d x^2\right )\right )^2 \, dx=\frac {a^2\,x^2}{2}-\frac {b^2}{d\,\left ({\mathrm {e}}^{2\,d\,x^2+2\,c}-1\right )}-\frac {2\,\mathrm {atan}\left (\frac {a\,b\,{\mathrm {e}}^{d\,x^2}\,{\mathrm {e}}^c\,\sqrt {-d^2}}{d\,\sqrt {a^2\,b^2}}\right )\,\sqrt {a^2\,b^2}}{\sqrt {-d^2}} \]

[In]

int(x*(a + b/sinh(c + d*x^2))^2,x)

[Out]

(a^2*x^2)/2 - b^2/(d*(exp(2*c + 2*d*x^2) - 1)) - (2*atan((a*b*exp(d*x^2)*exp(c)*(-d^2)^(1/2))/(d*(a^2*b^2)^(1/
2)))*(a^2*b^2)^(1/2))/(-d^2)^(1/2)